home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
GRAPHICS
/
TOOLS
/
TGDN
/
Docs
/
Extensions
< prev
next >
Wrap
Text File
|
1996-12-01
|
26KB
|
676 lines
Language Extensions
===================
1.0 Introduction
2.0 The RMStore directory
3.0 Structure
4.0 Resources
5.0 Coding
6.0 Calling internal commands
1.0 Introduction
~~~~~~~~~~~~~~~~
This document describes how to write language-extensions to the texture
generation language used in the Texture Garden program, reasons why you might
be interested in doing this and information about installing other people's
extension modules.
Commands may be included, but functions (refer to the "Language" file for the
differences between these) may not currently be implemented by third parties.
Example source code using the BASIC assembler is available. It is no longer
commonly distributed with the main TG archive (for reasons of space), and
the entire source code for Texture Garden's Kernel is also available.
Although this code is distributed as freeware (i.e. copyright is retained)
the author expresses every intention of approving use of my code where it is
incorporated into modules intended for my program, so please do not hesitate
to steal and butcher it; if this was objected to no source code would have
been distributed.
2.0 The RMStore directory
~~~~~~~~~~~~~~~~~~~~~~~~~
This is a directory immediately inside the "!TexturGdn" directory. The
location is usually "<TextureGdn$Dir>.RMStore". The precise location is held
in the system variable <TextureGdnRMStore$Dir> which is usually set up in the
!Run file.
This directory should always contain a text file called "Index". This file
has a simple format:
Any line starting with a "|" is considered to be a comment. The end of the
file is marked by the "End" token. Any other lines are considered as paths
from <TextureGdnRMStore$Dir> to files containing language extensions.
The file "Kernel" should always be present in the directory. It contains all
the commands implemented as the core of the language. There may also be
other files.
The files may be of any type. Conventionally, they are "Modules"
(Type &FFA). Though they are not loaded as such by the program this enables
them to conveniently contain a version number and help text.
When adding extension modules to the program the relevant file should be
added to the "RMStore" directory and the twig of its path inserted into the
"Index" file.
3.0 Structure
~~~~~~~~~~~~~
Language extensions should all conform to the following structure:
Bytes: Description...
&0000-&002B Header (Undefined bytes)
&002C-&XXXX Command Table index
&XXXX-&YYYY Command Table
&YYYY-&ZZZZ Command code
The Command Table index has the following format:
Offset bytes: Description...
&0000 Command index entry 0
&000C Command index entry 1
&0018 Command index entry 2
- -
n x &C Command index entry n
- -
&UUUU End of table marker.
The End of table marker is represented by the three consecutive words
-1,-1 and -1.
Command index entry n consists of three words
Word 0: Offset from start of file to the text of command n.
Word 1: Offset from start of file to the entry point of the code to perform
the command.
Word 2: Various flags
The Various flags are considered as &ABCDEFGH where &A is the number of
parameters the command accepts (0-15), &B is a code advising how the command
should be treated by the mutator (the "Mutation Options"), and &CDEFGH
contain other miscellaneous bit-flags to mark specific command types.
These bit-flags have the following meanings:
&000003 : (Reserved)
&00000C : See immediately below:
&4 : Command ends an indentation
&8 : Command starts an indentation
&0000F0 : (Reserved)
&00FF00 : As follows:
&0C00 : Command is an "endif" (Reserved)
&0200 : Command starts mutation (Reserved)
&0300 : Command stops mutation (Reserved)
&0400 : Command is a "Define" (Reserved)
&0500 : Command is a "Goto" (Reserved)
&0600 : Command is a "Call" (Reserved)
&0700 : Command is a "Return" (Reserved)
&0800 : Command is an "End" (Reserved)
&0900 : Command is an "If" (Reserved)
&0A00 : Command is an "Then" (Reserved)
&0B00 : Command is an "Else" (Reserved)
&0100 : Command is a "comment" ("|") (Reserved)
&0D00 : Command ends the colour definition (Reserved)
&0E00 : Command starts the colour definition (Reserved)
&0F00 : Command is a "CreateOneDiensionalFilter" (Reserved)
&1000 : Command is a "CreateTwoDiensionalFilter" (Reserved)
&1100 : Command is an "Until" (Reserved)
&1200 : Command is a "Resize" (Reserved)
&1300 : Command is a "ResizeSprite" (Reserved)
&1400 : Command is a "MakeSprite" (Reserved)
&1500 : Command is an "AddToSprite" (Reserved)
&1600 : Command is a "MakeVirtualSprite" (Reserved)
&1700 - &FF00 For expansion (Reserved)
&FF0000 : Bits all for expansion and must be zero (Reserved)
"Reserved" means that most users should not need to mess with it.
The "Command Table" contains the entries pointed to by word 0 of the Command
index entry. These are mixed case strings terminated by a single ASCII 13
character. They need not be word aligned.
The "Command code" contains the code pointed to by word 1 of the Command
index entry. These are ARM code subroutines called at the appropriate moment
in the generation of the textures. Any workspace may also be stored here,
rather than claimed from the system, if it is small enough. The location of
the "Command code" relative to the "Command table" is arbitrary.
Mutation Options
~~~~~~~~~~~~~~~~
This specifies how any following parameters are treated by the mutator.
0 - Completely ignore.
1 - Treat as unsigned 16-bit logarithmic number (reserved for functions)
2 - Very occasionally add or subtract one (used for "Shear")
3 - Occasionally completely randomize (used for "Seed")
4 - Treat as unsigned 16-bit logarithmic number
5 - Treat as a SetColour command...
6 - Treat as a DefineLightSource command.
7 - Reserved...
4.0 Resources
~~~~~~~~~~~~~
When a code fragment is called in the generation of a texture it may interact
with the main program and share its data in a number of ways.
On entry to the routine the following register conventions are used:
R14 - return address
R13 - system stack
R12 - pointer to Texture Garden main data structure
R11 - pointer to current point in texture program execution
On exit R0 - R10, R12 and R14 may be corrupted. R11 should normally be
incremented to the start of the next expected command. R13 should normally
be preserved in the normal manner.
R11 contains a pointer to the next item in the texture program's execution.
This will always be the next item after the code representing the currently
called command. Note that the program is not held internally as a textfile,
but in an internal format.
Each command, parameter or function is coded for by one word. Parameters are
coded for by their values. Commands and functions are coded bu an internal
number, the complete details of which are not specified, but which always has
bit 31 set. The end of the file is coded as -1. This need not normally be
checked for.
R12 contains a pointer to a data structure which has the following structure:
Brief list:
Routines
~~~~~~~~
&0000 : TG_getrnd - routine returning 32bit random number in R3
&0004 : TG_getrnd2 - routine returning 32bit random number in R3
&0008 : TG_getparameter - routine returning the value of the next parameter
&000C : TG_cstable - location of sin and cosine table.
&0010 : TG_astable - location of arcsin table.
&0014 : TG_forstac - location of stack of for addresses
&0018 : TG_forcoun - location of stack of for addresses
&001C : TG_itisthecodebank - location of 16 words of ARM code for "Combine"
&0020 : TG_onedimensionalfixsta - routine to start one-dimensional routines
&0024 : TG_onedimensionalfixend - routine to end one-dimensional routines
&0028 : TG_colourconversion - routine to perform conversion from 24-bit
&002C : TG_mcheap_get - allocate memory from heap
&0030 : TG_mcheap_release - deallocate memory in heap
&0034 : TG_reporterror - routine to report texture errors to the user
&0038 : TG_executesinglecommand - Single command execution routine
&003C : TG_convertcommandname - Converts pointer to command name
&0040 : TG_miscop - perform a variety of operations.
&0044 : Reserved
Data
~~~~
&0048 : TG_mainworkspaceaddress - the two-dimensional buffer
&004C : TG_totalsize - the size of the two-dimensional buffer
&0050 : TG_totalsizeminusone - the size of the two-dimensional buffer - 1
&0054 : TG_powertwo - Log to the base two of the size of the main buffer
&0058 : TG_powertwo_1D - Log to the base two of the 1D buffer size (10).
&005C : TG_dat - temp storage (4 bytes)
&0060 : TG_stack_temp - temp storage (4 bytes)
&0064 : TG_cnd - temp storage (4 bytes)
&0068 : TG_scrapaddress - address of temp storage (at least &800 bytes.)
&006C : TG_actualphase - Current phase to be used in FFTs
&0070 : TG_actualnoise - Amplitude of noise to be filtered
&0074 : TG_cosamag - Cosine artefacts magnitude
&0078 : TG_sinamag - Sine artefacts magnitude
&007C : TG_precultflags - flags for FFT
&0080 : TG_tempb - temp storage (4 bytes)
&0084 : TG_tempb2 - temp storage (4 bytes)
&0088 : TG_onedeebuffertwo - the secondary two-dimensional buffer
&008C : TG_onedeebufferone - the primary two-dimensional buffer
&0090 : TG_onedeebuffer - the two-dimensional buffer
&0094 : TG_forcntr - the depth of the current for nesting
&0098 : TG_dithering - Dithering
&009C : TG_ditheringOne - DitheringOne
&00A0 : TG_ditheringTwo - DitheringTwo
&00A4 : TG_resultoftestpar - internal communications
&00A8 : TG_resultoftestparP4 - internal communications
&00AC : TG_seed - Seed (Low word)
&00B0 : TG_seedP4 - Seed (High word)
&00B4 : TG_seedTwo - Seed Two (Low word)
&00B8 : TG_seedTwoP4 - Seed Two (High word)
&00BC : TG_aframesmem% - Number of current animation frame
&00C0 : TG_aframetype% - Address of table of 1024 nibbles animation type
&00C4 : TG_areweanimating - Flag
&00C8 : TG_blockmem% - address of a temp storage bank
&00CC : TG_block2mem% - address of a temp storage bank
&00D0 : TG_spriteaddress - address of the current sprite
&00D4 : TG_spritearea - address of the main sprite area
&00D8 : TG_spritepaladdress - address of the current palette sprite
&00DC : TG_spriteXoriginal - used in resizing sprite
&00E0 : TG_spriteYoriginal - used in resizing sprite
&00E4 : TG_spriteXactual - used in resizing sprite
&00E8 : TG_spriteYactual - used in resizing sprite
&00EC : TG_modenumber - Number of current mode
&00F0 : TG_log2BPP - Log to the base two of the number of bits per pixel
&00F4 : TG_XEigenFactor - The X Eigen Factor of the mode
&00F8 : TG_YEigenFactor - The Y Eigen Factor of the mode
&00FC : TG_cmd_ifmem - Number to detect "If"s with
&0100 : TG_cmd_elsemem - Number to detect "Else"s with
&0104 : TG_cmd_endifmem - Number to detect "Endif"s with
&0108 : TG_cmd_define - Number to detect "Define"s with
&010C : TG_cmd_ifyetq - Flag to detect if there has been an if on the line
&0110 : TG_colourmapcorrupt - Set if TG_colourconversion has been called
&0114 : TG_AddressOfSolidBlock - Address of last DefineSolidBlock command
&0118 : TG_memorystoreone - Address of claimed memory to be released
&011C : TG_memorystoretwo - Address of claimed memory to be released
&0120 : TG_FirstDefinition - zero of address of first "Define" command
&0124 : TG_CallStackMem - Not used
&0128 : TG_customresize - Set if resizing is not done with "ResizeSprite"
&012C : TG_percentage - Reflects the hourglass percentage
&0130 : TG_red - The red component of the current colour (0-&FFFF)
&0134 : TG_green - The green component of the current colour (0-&FFFF)
&0138 : TG_blue - The blue component of the current colour (0-&FFFF)
&013C : TG_lstable - The address of the light source table
&0140 : TG_lscounter - The number of light sources defined so far
&0144 : TG_Xresize - \ The values of the last parameters passed to
&0148 : TG_Yresize - / either Resize or ResizeBumpMap
&014C : TG_registered - 0 if the Freeware version is in use (read only)
Those "Routines" in the above list which may be called can be reached by
using the following code:
MOV R14,PC
LDR PC,[R12,#<TG_routineoffset>]
In the examples this is a macro called "calltg".
Descriptive list:
Routines
~~~~~~~~
TG_getrnd (&0000)
Entry : none
Exit : corrupts R4 returns 32bit random number in R3.
TG_getrnd2 (&0004)
Entry : none
Exit : corrupts R0 returns 32bit random number in R3.
Notes : This command uses a different seed to the one above.
TG_getparameter (&0008)
Entry : R11 points to current mark in program.
Exit : R10 returns the value of the next parameter.
R11 updated to point to next point in program.
TG_cstable (&000C)
Location of sin and cosine table. 2048 words, format as follows:
Word0 : Cosine(2*PI/1024 x 0) x 2^15
Word1 : Sine(2*PI/1024 x 0) x 2^15
Word2 : Cosine(2*PI/1024 x 1) x 2^15
Word3 : Sine(2*PI/1024 x 1) x 2^15
Word4 : Cosine(2*PI/1024 x 2) x 2^15
Word5 : Sine(2*PI/1024 x 2) x 2^15
... : ...
Word2046 : Cosine(2*PI/1024 x 1023) x 2^15
Word2047 : Sine(2*PI/1024 x 1023) x 2^15
TG_astable (&0010)
Arcsin table. 256 bytes.
TG_forstac (&0014)
Location of stack of for addresses.
TG_forcoun (&0018)
Location of stack of for addresses.
TG_itisthecodebank (&001C)
Location of 16 words of ARM code for "Combine"
The words are as follows:
&0 : CMP A,#&10000
&1 : MOVS A,A,LSR #16
&2 : MOVS A,A,LSL #16
&3 : EorS A,A,#&8000
&4 : ADDS A,A,9
&5 : CMP A,9
&6 : SUBS A,A,9
&7 : MOVCS A,#&10000
&8 : RSBCS A,A,#&20000
&9 : RSBMI A,A,#&0
&A : MOVMI A,#&0
&B : MOVCC A,9
&C : MOVCS A,9
&D : SUBCS A,A,#1
&E : MOVS A,A,LSR #1
&F : MULS A,9,A
TG_onedimensionalfixsta (&0020)
Routine to start one-dimensional routines.
TG_onedimensionalfixend (&0024)
Routine to end one-dimensional routines.
TG_colourconversion (&0028)
Routine to perform conversion of the palette from 24-bit colour in the
format &RRGGBBXX to a series of bytes representing the colour number of
the colour for the mode.
TG_mcheap_get (&002C)
This allocates memory from Texture Garden's heap
Entry : R0 contains number of bytes requested.
Exit : R0 : 0 (an error has occurred (V is also set), or...
R0 : contains a pointer to the memory.
R1 - R7 corrupted.
Note: this routine returns an error by setting the V flag and setting R0
to 0.
TG_mcheap_release (&0030)
This deallocates memory which has been previously allocated from Texture
Garden's heap.
Entry : R0 contains a pointer to the memory.
Exit : R0 : 0 : an error has occurred (V is also set), or...
R0 : 1 : sucessful.
R1 - R7 corrupted.
Note: this routine returns an error by setting the V flag and setting R0
to 0.
TG_reporterror (&0034)
Entry : R0 points to the error string
Exit : *** This routine does not return ***
TG_executesinglecommand (&0038) - Single command execution routine.
Entry : R11 points to the command to be executed.
Exit : R0 - R10 and R12 are corrupted. R11 points to immediately after
the command.
TG_convertcommandname (&003C) - Converts pointer to command name.
Entry : R0 points to the command to be converted.
Exit : R0 contains the corresponding internal command code.
TG_miscop (&0040) - Performs a variety of miscellaneous operations.
Entry : R0 contains the reason code, see the following list:
Entry : R0 = 0;
Allocate memory for another two dimensional buffer, if required and
return a pointer to it in R10.
Exit : R0 to R9 are corrupted.
Entry : R0 = 1;
Allocate memory for a virtual sprite if required and return a pointer to
it in R10.
Exit : R0 to R9 are corrupted.
Entry : R0 = 2; R1,R2,R3 are as "OS_SpriteOp" with R0 = &22E.
Delete columns from an existing sprite. This is equivalent to
XOS_SpriteOp with R0 = &22E, except that it does not produce errors when
applied to deep sprites on pre-RISC OS 3.5 machines.
Exit : R10 is are corrupted.
Entry : R0 = 3;
Allocate memory for a virtual palette sprite if required and return a
pointer to it in R10.
Exit : R0 to R9 are corrupted.
All other TG_miscop reason codes are reserved.
5.0 Coding
~~~~~~~~~~
Example source (in the BASIC assembler) should be available in the
"Library.Source.Extra" file and the "Library.Source.Kernel" file. These
files are no longer distributed with most versions of Texture Garden, but
should be available from its main web site.
If a command takes longer than about 0.2 seconds, then it should check the
escape key at regular intervals (using an INKEY(minus) equivalent) and
terminate if it is pressed.
On entry to its routine, a command usually starts by getting its relevant
parameters. These should always be checked to see if they are functions, and
evaluated if this is the case. It is recommended that the following code be
used to get each one:
LDR R10,[R11],#4
TST R10,#&80000000
MOVNE R14,PC
LDRNE PC,[R12,#TG_getparameter]
This is used so frequently that it really cries out to be a macro.
"getrecursiveparam" is its name in the examples.
The "Routine" TG_getparameter will normally preserve R0-R7, R12 and R13. R8
and R9 may be corrupted. R10 contains the returned result of the function.
R11 is updated to point to the next word of interest.
Another command which will be used frequently relates to the implementation
of the "combination type" commands. Programmers may implement these in
whatever manner they choose. The author finds them to be best implemented
using the following self-modifying code for speed, though this may cause a
speed penalty for those with StrongARM chips.
In my routines, the following functions are used.
DEFFNgetaddparam(alse%) ... corrupts R0-R3
[OPT Pass%
LDR 0,[C,#TG_itisthecodebank]
ADR 1,alse%
And 2,R10,#&F
LDR 3,[0,2,ASL #2]
STR 3,[1]
MOV R10,R10,LSR #4
And 2,R10,#&F
LDR 3,[0,2,ASL #2]
STR 3,[1,#4]
MOV R10,R10,LSR #4
And 2,R10,#&F
LDR 3,[0,2,ASL #2]
STR 3,[1,#8]
MOV R10,R10,LSR #4
And 2,R10,#&F
LDR 3,[0,2,ASL #2]
STR 3,[1,#12]
MOV 0,#1
ADD 2,1,#12
SWI &2006E ; REM XOS_SynchroniseCodeAreas
]
= Pass%
DEFFNfourwords
[OPT Pass%
MOV R10,R10
MOV R10,R10
MOV R10,R10
MOV R10,R10
]
= Pass%
These are called as follows...
.command_entry
...
OPT FNgetrecursiveparam ...see above
OPT FNgetaddparam(code_insertion)
...
.code_insertion
OPT FNfourwords
...
The two values to be combined should be held in R9 (old) and R10 (new value)
when "code_insertion" is reached. The data table at TG_itisthecodebank
contains the following pieces of code:
CMP A,#&10000 ; 0
MOVS A,A,LSR #16 ; 1
MOVS A,A,LSL #16 ; 2
EorS A,A,#&8000 ; 3
ADDS A,A,9 ; 4
CMP A,9 ; 5
SUBS A,A,9 ; 6
MOVCS A,#&10000 ; 7
RSBCS A,A,#&20000 ; 8
RSBMI A,A,#&0 ; 9
MOVMI A,#&0 ; A
MOVCC A,9 ; B
MOVCS A,9 ; C
SUBCS A,A,#1 ; D
MOVS A,A,LSR #1 ; E
MULS A,9,A ; F
Examination of FNgetaddparam should reveal that four values from the above
table are taken according to the value of the four nibbles of the given
parameter and stored at "code_insertion", least-significant nibble first.
6.0 Calling internal commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"TG_executesinglecommand" and "TG_convertcommandname" may be used by commands
to call other commands directly. This is done in a crude manner,
constructing the command in memory, and then setting the command pointer to
point to it and then calling Texture Garden.
"TG_convertcommandname" should be used to convert the command name to a
command code. This step is important, as command codes are not guaranteed
to be the same across different instantiations of the program, and they
depend on which extension modules are loaded. They only need to be
calculated once each time Texture Garden is run.
Commands should be stored in memory locally and followed by any parameters.
Commands may be of any case, and may be abbreviated by using the "."
character (however, using this feature is very bad practise).
After the command codes and their parameters are all placed into consecutive
words of memory, the current value of the command pointer (usually in R11)
should then be saved, the location of the command to be executed should be
loaded into R11 and "TG_executesinglecommand" should be called.
Then the command pointer should be recovered from wherever it was saved.
Note: "TG_executesinglecommand" executes one command only. The command
should not be a comment or one of "If", "Then" or "Else"; the functionality
of these may be mimicked manually.
Expression evaluation may be performed using a similar method, ie. set up the
expression in coded form in memory, store R11, set R11 to point to the
expression, and then use FNgetrecursiveparam (or its equivalent macro - see
above) to evaluate it, restoring R11 afterwards.
The only functions in Texture Garden that currently use this functionality
are the "SlowRotate" commands. These use the "TwoDimensionalPoint" function
to help them with their anti-aliasing.
In principle, any commonly used subroutine may be more efficiently
implemented as a hard-wired command using this technique.
Because "TG_convertcommandname" performs a slow lookup, a number of common
expression evaluation functions are assigned particular code numbers.
The following command names are guaranteed to be given numbers as follows:
&80000000 - "UnknownCommand" ; please do not use.
&80000001 - "Combine"
&80000002 - "ScaledSignedMultiply"
&80000003 - "SignedMultiply"
&80000004 - "PartlyScaledSignedMultiply"
&80000005 - "PartlyScaledMultiply"
&80000006 - "Divide"
&80000007 - "Eor"
&80000008 - "And"
&80000009 - "Or"
&8000000A - "LogicalShiftLeft"
&8000000B - "LogicalShiftRight"
&8000000C - "ArithmeticShiftLeft"
&8000000D - "ArithmeticShiftRight"
&8000000E - "Absolute"
&8000000F - "Variable"
&80000010 - "Random"
&80000011 - "SimpleAddition"
&80000012 - "UnboundedAddition"
&80000013 - "CeilingAddition"
&80000014 - "HalvingAddition"
&80000015 - "SimpleSubtraction"
&80000016 - "UnboundedSubtraction"
&80000017 - "FloorSubtraction"
&80000018 - "HalvingSubtraction"
&80000019 - "Maximise"
&8000001A - "Minimise"
&8000001B - "Overwrite"
&8000001C - "PositiveOverwrite"
&8000001D - "Preserve"
&8000001E - "Multiplication"
&8000001F - "ScaledMultiplication"
&80000020 - "Zeroise"
&80000021 - "True"
&80000022 - "False"
&80000023 - "Zero"
&80000024 - "Ninety"
&80000025 - "OneHundredAndEighty"
&80000026 - "TwoHundredandSeventy"
&80000027 - "FloydSteinberg"
&80000028 - "IsLessThan"
&80000029 - "IsGreaterThan"
&8000002A - "IsLessThanOrEqualTo"
&8000002B - "IsGreaterThanOrEqualTo"
&8000002C - "SignedIsLessThan"
&8000002D - "SignedIsGreaterThan"
&8000002E - "SignedIsLessThanOrEqualTo"
&8000002F - "SignedIsGreaterThanOrEqualTo"
&80000030 - "IsEqualTo"
&80000031 - "IsNotEqualTo"
&80000032 - "Sin"
&80000033 - "Cos"
&80000034 - "SignedSin"
&80000035 - "SignedCos"
&80000036 - "SquareRoot"
&80000037 - "Noise"
&80000038 - "PinkNoise"
&80000039 - "QuickNoise"
&8000003A - "BandpassNoise"
&8000003B - "BandpassQuickNoise"
&8000003C - "FractalNoise"
&8000003D - "ShiftedSymmetricNoise"
&8000003E - "ShiftedSymmetricPinkNoise"
&8000003F - "ShiftedNoise"
&80000040 - "ShiftedPinkNoise"
&80000041 - "ShiftedSymmetricQuickNoise"
&80000042 - "ShiftedQuickNoise"
&80000043 - "ShiftedSymmetricFractalNoise"
&80000044 - "ShiftedFractalNoise"
&80000045 - "TwoDimensionalPoint"
&80000046 - "QuickTwoDimensionalPoint"
&80000047 - "OneDimensionalPoint"
&80000048 - "QuickOneDimensionalPoint"
&80000049 - "OneDimensionalPointOne"
&8000004A - "QuickOneDimensionalPointOne"
&8000004B - "OneDimensionalPointTwo"
&8000004C - "QuickOneDimensionalPointTwo"
&8000004D - "X"
&8000004E - "Y"
&8000004F - "Z"
&80000050 - "Size"
&80000051 - "LogSize"
&80000052 - "LogBitsPerPixel"
&80000053 - "AnimationType"
&80000054 - "AnimationFrameNumber"
&80000055 - "Add"
&80000056 - "Subtract"
&80000057 - "Maximise"
&80000058 - "Minimise"
&80000059 - "Multiply"
&8000005A - "RGB"
&8000005B - "HSV"
&8000005C - "CIE"
&8000005D - ... reserved.
These functions all preserve R0-R7 and return their value in R10, updating
R11 according to the number of parameters they take. They operate by
evaluating their parameters in a recursive fashion.
X-, Y- and Z-based functions are expecting to find their values in R2, R3 and
R4 respectively, and they depend upon this for their operation.
Functions which fit into this category include those from "Noise" to
"ShiftedFractalNoise" as well as the more obvious "X", "Y" and "Z". These
functions will not return sensible vaules unless R2, R3 and R4 are set up
probably before they are called.
In general, different copies of Texture Garden will use different coding
schemes for the numbers they assign to their commands. It is recommended
that you do not rely on the numbers given to commands (apart from those
explicitly mentioned in the list above) as being constant, though within
any given instantiation of Texture Garden, they will not change, so commands
only need to be looked up once.
More information relating to writing extension modes is contained in the rest
of the documentation, notably the "Distribute", "Language" and "Technical"
files.